.class public Lcom/instagram/android/feed/a/m;
.super Lcom/instagram/android/feed/a/a;
.source "MainFeedAdapter.java"

# interfaces
.implements Lcom/instagram/android/feed/e/f;


# instance fields
.field protected e:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lcom/instagram/pendingmedia/model/c;",
            ">;"
        }
    .end annotation
.end field

.field private f:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lcom/instagram/android/model/f;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>(Lcom/instagram/android/fragment/d;Lcom/instagram/android/feed/a/i;)V
    .locals 1
    .parameter
    .parameter

    .prologue
    .line 34
    invoke-direct {p0, p1, p2}, Lcom/instagram/android/feed/a/a;-><init>(Lcom/instagram/android/fragment/d;Lcom/instagram/android/feed/a/i;)V

    .line 26
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/instagram/android/feed/a/m;->e:Ljava/util/List;

    .line 35
    return-void
.end method

.method private s()I
    .locals 1

    .prologue
    .line 48
    iget-object v0, p0, Lcom/instagram/android/feed/a/m;->f:Ljava/util/List;

    if-nez v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x1

    goto :goto_0
.end method

.method private t()I
    .locals 1

    .prologue
    .line 52
    iget-object v0, p0, Lcom/instagram/android/feed/a/m;->e:Ljava/util/List;

    if-nez v0, :cond_0

    const/4 v0, 0x0

    :goto_0
    return v0

    :cond_0
    iget-object v0, p0, Lcom/instagram/android/feed/a/m;->e:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    goto :goto_0
.end method


# virtual methods
.method protected a(Landroid/content/Context;)Landroid/view/View;
    .locals 2
    .parameter

    .prologue
    .line 108
    new-instance v0, Landroid/widget/LinearLayout;

    invoke-direct {v0, p1}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;)V

    .line 109
    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Landroid/widget/LinearLayout;->setOrientation(I)V

    .line 110
    return-object v0
.end method

.method protected a(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
    .locals 2
    .parameter
    .parameter
    .parameter

    .prologue
    .line 92
    invoke-virtual {p0}, Lcom/instagram/android/feed/a/m;->k()I

    move-result v0

    if-lt p2, v0, :cond_0

    .line 93
    invoke-super {p0, p1, p2, p3}, Lcom/instagram/android/feed/a/a;->a(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v0

    .line 101
    :goto_0
    return-object v0

    .line 96
    :cond_0
    invoke-virtual {p0, p2}, Lcom/instagram/android/feed/a/m;->getItemViewType(I)I

    move-result v0

    .line 98
    const/4 v1, 0x0

    invoke-virtual {p0, v1}, Lcom/instagram/android/feed/a/m;->f(I)I

    move-result v1

    if-ne v1, v0, :cond_1

    .line 99
    sget-object v0, Lcom/instagram/android/a/b/p;->a:Lcom/instagram/android/a/b/p;

    invoke-static {p1, v0}, Lcom/instagram/android/a/b/k;->a(Landroid/content/Context;Lcom/instagram/android/a/b/p;)Landroid/view/View;

    move-result-object v0

    goto :goto_0

    .line 100
    :cond_1
    const/4 v1, 0x1

    invoke-virtual {p0, v1}, Lcom/instagram/android/feed/a/m;->f(I)I

    move-result v1

    if-ne v1, v0, :cond_2

    .line 101
    invoke-virtual {p0, p1}, Lcom/instagram/android/feed/a/m;->a(Landroid/content/Context;)Landroid/view/View;

    move-result-object v0

    goto :goto_0

    .line 103
    :cond_2
    new-instance v0, Ljava/lang/UnsupportedOperationException;

    const-string v1, "View type not handled"

    invoke-direct {v0, v1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method protected a(Landroid/content/Context;Landroid/view/View;I)V
    .locals 2
    .parameter
    .parameter
    .parameter

    .prologue
    .line 115
    invoke-virtual {p0}, Lcom/instagram/android/feed/a/m;->k()I

    move-result v0

    if-lt p3, v0, :cond_0

    .line 116
    invoke-super {p0, p1, p2, p3}, Lcom/instagram/android/feed/a/a;->a(Landroid/content/Context;Landroid/view/View;I)V

    .line 131
    :goto_0
    return-void

    .line 120
    :cond_0
    invoke-virtual {p0, p3}, Lcom/instagram/android/feed/a/m;->getItemViewType(I)I

    move-result v0

    .line 122
    const/4 v1, 0x0

    invoke-virtual {p0, v1}, Lcom/instagram/android/feed/a/m;->f(I)I

    move-result v1

    if-ne v1, v0, :cond_1

    .line 123
    invoke-virtual {p2}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/instagram/android/a/b/n;

    invoke-virtual {p0, p3}, Lcom/instagram/android/feed/a/m;->getItem(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/instagram/pendingmedia/model/c;

    invoke-static {p1, v0, v1}, Lcom/instagram/android/a/b/k;->a(Landroid/content/Context;Lcom/instagram/android/a/b/n;Lcom/instagram/pendingmedia/model/c;)V

    goto :goto_0

    .line 126
    :cond_1
    const/4 v1, 0x1

    invoke-virtual {p0, v1}, Lcom/instagram/android/feed/a/m;->f(I)I

    move-result v1

    if-ne v1, v0, :cond_2

    .line 127
    invoke-virtual {p0, p1, p2, p3}, Lcom/instagram/android/feed/a/m;->b(Landroid/content/Context;Landroid/view/View;I)V

    goto :goto_0

    .line 129
    :cond_2
    new-instance v0, Ljava/lang/UnsupportedOperationException;

    const-string v1, "View type not handled"

    invoke-direct {v0, v1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method public a(Ljava/util/List;)V
    .locals 0
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Lcom/instagram/pendingmedia/model/c;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 38
    iput-object p1, p0, Lcom/instagram/android/feed/a/m;->e:Ljava/util/List;

    .line 39
    invoke-virtual {p0}, Lcom/instagram/android/feed/a/m;->notifyDataSetChanged()V

    .line 40
    return-void
.end method

.method protected b(Landroid/content/Context;Landroid/view/View;I)V
    .locals 4
    .parameter
    .parameter
    .parameter

    .prologue
    .line 143
    const/4 v2, 0x0

    move-object v0, p2

    .line 146
    check-cast v0, Landroid/widget/LinearLayout;

    invoke-virtual {v0}, Landroid/widget/LinearLayout;->removeAllViews()V

    .line 149
    iget-object v0, p0, Lcom/instagram/android/feed/a/m;->f:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :goto_0
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/instagram/android/model/f;

    move-object v1, p2

    .line 150
    check-cast v1, Landroid/widget/LinearLayout;

    invoke-virtual {v0, p1, p0}, Lcom/instagram/android/model/f;->a(Landroid/content/Context;Lcom/instagram/android/feed/a/m;)Landroid/view/View;

    move-result-object v0

    invoke-virtual {v1, v0}, Landroid/widget/LinearLayout;->addView(Landroid/view/View;)V

    goto :goto_0

    .line 154
    :cond_0
    iget-object v0, p0, Lcom/instagram/android/feed/a/m;->f:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v3

    :goto_1
    invoke-interface {v3}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-interface {v3}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/instagram/android/model/f;

    move-object v1, p2

    .line 155
    check-cast v1, Landroid/widget/LinearLayout;

    invoke-virtual {v1, v2}, Landroid/widget/LinearLayout;->getChildAt(I)Landroid/view/View;

    move-result-object v1

    invoke-virtual {v1}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/instagram/android/model/f;->a(Ljava/lang/Object;)V

    .line 156
    add-int/lit8 v0, v2, 0x1

    move v2, v0

    .line 157
    goto :goto_1

    .line 158
    :cond_1
    return-void
.end method

.method public b(Ljava/util/List;)V
    .locals 0
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Lcom/instagram/android/model/f;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 165
    iput-object p1, p0, Lcom/instagram/android/feed/a/m;->f:Ljava/util/List;

    .line 166
    invoke-virtual {p0}, Lcom/instagram/android/feed/a/m;->notifyDataSetChanged()V

    .line 167
    return-void
.end method

.method protected b(Lcom/instagram/j/l;)Z
    .locals 1
    .parameter

    .prologue
    .line 176
    invoke-super {p0, p1}, Lcom/instagram/android/feed/a/a;->b(Lcom/instagram/j/l;)Z

    move-result v0

    if-eqz v0, :cond_0

    invoke-static {}, Lcom/instagram/android/feed/d/j;->a()Lcom/instagram/android/feed/d/j;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/instagram/android/feed/d/j;->a(Lcom/instagram/j/l;)Z

    move-result v0

    if-nez v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public getItem(I)Ljava/lang/Object;
    .locals 2
    .parameter "position"

    .prologue
    .line 57
    invoke-virtual {p0}, Lcom/instagram/android/feed/a/m;->k()I

    move-result v0

    if-le v0, p1, :cond_1

    .line 58
    invoke-direct {p0}, Lcom/instagram/android/feed/a/m;->s()I

    move-result v0

    if-le v0, p1, :cond_0

    .line 59
    iget-object v0, p0, Lcom/instagram/android/feed/a/m;->f:Ljava/util/List;

    .line 64
    :goto_0
    return-object v0

    .line 61
    :cond_0
    iget-object v0, p0, Lcom/instagram/android/feed/a/m;->e:Ljava/util/List;

    invoke-direct {p0}, Lcom/instagram/android/feed/a/m;->s()I

    move-result v1

    sub-int v1, p1, v1

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    goto :goto_0

    .line 64
    :cond_1
    invoke-super {p0, p1}, Lcom/instagram/android/feed/a/a;->getItem(I)Ljava/lang/Object;

    move-result-object v0

    goto :goto_0
.end method

.method public getItemViewType(I)I
    .locals 2
    .parameter "position"

    .prologue
    .line 75
    invoke-virtual {p0}, Lcom/instagram/android/feed/a/m;->k()I

    move-result v0

    if-lt p1, v0, :cond_0

    .line 76
    invoke-super {p0, p1}, Lcom/instagram/android/feed/a/a;->getItemViewType(I)I

    move-result v0

    .line 84
    :goto_0
    return v0

    .line 79
    :cond_0
    invoke-virtual {p0, p1}, Lcom/instagram/android/feed/a/m;->getItem(I)Ljava/lang/Object;

    move-result-object v0

    .line 81
    instance-of v1, v0, Lcom/instagram/pendingmedia/model/c;

    if-eqz v1, :cond_1

    .line 82
    const/4 v0, 0x0

    invoke-virtual {p0, v0}, Lcom/instagram/android/feed/a/m;->f(I)I

    move-result v0

    goto :goto_0

    .line 83
    :cond_1
    instance-of v0, v0, Ljava/util/List;

    if-eqz v0, :cond_2

    .line 84
    const/4 v0, 0x1

    invoke-virtual {p0, v0}, Lcom/instagram/android/feed/a/m;->f(I)I

    move-result v0

    goto :goto_0

    .line 86
    :cond_2
    new-instance v0, Ljava/lang/UnsupportedOperationException;

    const-string v1, "Unhandled instance type"

    invoke-direct {v0, v1}, Ljava/lang/UnsupportedOperationException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method public getViewTypeCount()I
    .locals 1

    .prologue
    .line 70
    invoke-super {p0}, Lcom/instagram/android/feed/a/a;->getViewTypeCount()I

    move-result v0

    add-int/lit8 v0, v0, 0x2

    return v0
.end method

.method public k()I
    .locals 2

    .prologue
    .line 44
    invoke-direct {p0}, Lcom/instagram/android/feed/a/m;->s()I

    move-result v0

    invoke-direct {p0}, Lcom/instagram/android/feed/a/m;->t()I

    move-result v1

    add-int/2addr v0, v1

    return v0
.end method
